package com.zpc.myvideoserver.mapper;

import com.zpc.myvideoserver.entity.Collect;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zpc.myvideoserver.entity.Vo.CollectVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 视频收藏表 Mapper 接口
 * </p>
 *
 * @author zpc
 * @since 2023/11/03
 */
public interface CollectMapper extends BaseMapper<Collect> {
    @Select("<script>" +
            "select a.*,c.name username,b.video_name videoName,b.cover_name coverName \n" +
            "from collect a  \n" +
            "left join user c on a.user_id=c.id \n" +
            "left join video b on a.video_id=b.id"+
            "</script>")
    List<CollectVo> getAllCollect();
}
